//
//  MyDocument.h
//  This file is part of D&D Manager
//
//  Created by Matthew Hutton on 30/09/2006.
//
//D&D Manager, a D&D Character and battle management program.
//Copyright (C) 2006-2007, Matthew Hutton
//
//This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License along with this program; if not, write to:
//The Free Software Foundation, Inc.,
//51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#import <Cocoa/Cocoa.h>
#import "AppController.h"

@interface MyDocument : NSPersistentDocument {
	IBOutlet AppController *appController;
	NSMutableArray *origObjectsCopied;
	NSMutableArray *newObjectsCopied;
	MenuController *menuController;
	IBOutlet NSWindow *mainWindow;
	IBOutlet NSWindow *softwareLicencePanel;
	IBOutlet NSButton *alwaysDisplayButton;
	BOOL licenceShowedThisSession;
	BOOL windowShown;
	//characters/spells in other files.
	NSMutableArray *allCharacters;
	NSMutableArray *allSpells;
	NSMutableArray *selectedCharacters;
	NSMutableArray *selectedSpells;
	IBOutlet NSTableView *importCharacterTable;
	IBOutlet NSTableView *importSpellTable;
	IBOutlet NSTableView *importCharacterTable2;
	IBOutlet NSTableView *importSpellTable2;
	IBOutlet NSWindow *importSheet;
	IBOutlet NSTabView *importTabs;
	IBOutlet NSTabView *mainTabView;
}
-(IBAction)importCharactersFromOtherFiles:(id)sender;
-(IBAction)refreshCharactersAndSpells:(id)sender;
-(NSArray *)getAllCharacters;
-(NSArray *)getAllSpells;
-(IBAction)addCharactersToImport:(id)sender;
-(IBAction)removeCharactersFromImport:(id)sender;
-(IBAction)addSpellsToImport:(id)sender;
-(IBAction)removeSpellsFromImport:(id)sender;
-(IBAction)actuallyImporting:(id)sender;
-(IBAction)cancelImport:(id)sender;
-(void)windowDidBecomeKey:(NSNotification *)aNotification;
-(void)windowDidUpdate:(NSNotification *)aNotification;
-(void)windowWillClose:(NSNotification *)aNotification;
-(void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void *)contextInfo;
-(IBAction)licenceAgreed:(id)sender;
-(IBAction)licenceNotAgreed:(id)sender;
-(AppController *)appController;
-(int)indexInOrigObjectsOfTheObject:(NSManagedObject *)obj;
-(NSManagedObject *)origObjectAtIndex:(int)index;
-(NSManagedObject *)newObjectAtIndex:(int)index;
-(void)addOrigObject:(NSManagedObject *)obj;
-(void)addNewObject:(NSManagedObject *)obj;
-(void)clearDuplicationArrays;
@end
